import Base from './bash'
function esureHash() {
  
  if (location.hash) {
    return
  }
  location.hash = "/" //没有hash就默认一个/    
  console.log(111111111111);
}
class HASHHistory extends Base{
  constructor(router) {
    super(router);
    esureHash()
  }
  setupListener() {
    window.addEventListener("hashchange", () => {
      let hashValue = location.hash.slice(1)
      this.transitionTo(hashValue)
    })
  }
  getCurrentLocation() {
    return location.hash.slice(1)
  }
  push(location) {
    this.transitionTo(location, () => {
      window.location.hash = location
    })
  }
}
export default HASHHistory;